<template>
  <div style="width: 500px;">
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="杆塔编号">
        <el-input v-model="form.gtid"></el-input>
      </el-form-item>
      <el-form-item label="缺陷级别">
        <el-select  style=" margin-left: -190px;" v-model="form.qxjb" placeholder="请选择缺陷级别">
          <el-option label="一般" value="一般"></el-option>
          <el-option label="严重" value="严重"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="缺陷类型">
        <el-select style=" margin-left: -190px;" v-model="form.leixin" placeholder="请选择缺陷类型">
          <el-option label="类型1" value="类型1"></el-option>
          <el-option label="类型2" value="类型2"></el-option>
          <el-option label="类型3" value="类型3"></el-option>
          <el-option label="类型4" value="类型4"></el-option>
          <el-option label="类型5" value="类型5"></el-option>
          <el-option label="类型6" value="类型6"></el-option>
          <el-option label="类型7" value="类型7"></el-option>
          <el-option label="类型8" value="类型8"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="发现人">
        <el-select style=" margin-left: -190px;" v-model="form.use" placeholder="发现人">
          <el-option label="发现人1" value="发现人1"></el-option>
          <el-option label="发现人2" value="发现人2"></el-option>
          <el-option label="发现人3" value="发现人3"></el-option>
          <el-option label="发现人4" value="发现人4"></el-option>
          <el-option label="发现人5" value="发现人5"></el-option>
          <el-option label="发现人6" value="发现人6"></el-option>
          <el-option label="发现人7" value="发现人7"></el-option>
          <el-option label="发现8人" value="发现人8"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="下发人">
        <el-select style=" margin-left: -190px;" v-model="form.xfuser" placeholder="任务下发人">
          <el-option label="任务下发人1" value="任务下发人1"></el-option>
          <el-option label="任务下发人2" value="任务下发人2"></el-option>
          <el-option label="任务下发人3" value="任务下发人3"></el-option>
          <el-option label="任务下发人4" value="任务下发人4"></el-option>
          <el-option label="任务下发人5" value="任务下发人5"></el-option>
          <el-option label="任务下发人6" value="任务下发人6"></el-option>
          <el-option label="任务下发人7" value="任务下发人7"></el-option>
          <el-option label="任务下发人8" value="任务下发人8"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item  label="发现时间">
        <el-col :span="11">
          <el-date-picker format="yyyy-MM-dd" type="date" placeholder="发现时间" v-model="form.date1" style="width: 100%;"></el-date-picker>
        </el-col>
      </el-form-item>
      <el-form-item label="下发时间">
        <el-col :span="11">
          <el-date-picker format="yyyy-MM-dd" type="date" placeholder="发现时间" v-model="form.date2" style="width: 100%;"></el-date-picker>
        </el-col>
      </el-form-item>

      <el-form-item label="完好率">
        <el-input v-model="form.whl"></el-input>
      </el-form-item>
      <el-form-item label="缺陷描述">
        <el-input v-model="form.qxms"></el-input>
      </el-form-item>
      <el-form-item label="巡检任务编号">
        <el-input v-model="form.xunjianrwid"></el-input>
      </el-form-item>
      <el-form-item label="任务编号">
        <el-input v-model="form.rwid"></el-input>
      </el-form-item>
      <router-link to="/XQchaxun">
        <el-button type="primary" @click="onSubmit">立即创建</el-button>
      </router-link>
      <router-link to="/XQchaxun">
        <el-button @click="visible=false">取消</el-button>
      </router-link>
      </el-form-item>
    </el-form>

  </div>
</template>
<script>
  import axios from 'axios';
  export default {
    data() {
      return {
        form: {
          gtid: '',
          qxjb: '', //缺陷级别
          date1: new Date(),
          date2: new Date(),
          whl: '', //完好率
          qxms: '', //缺陷描述
          cz: '', //操作
          leixin: '', //缺陷类型
          use: '', //发现人
          xfuser: '', //下发人
          rwid: '',
          xunjianrwid: '',
          delivery: false,
          type: []
        }
      }
    },
    methods: {
      onSubmit: function() {
        console.log(this.form);
        axios.get("/qx/insert", {
          params: {
            findUser: this.form.use,
            gtid: this.form.gtid,
            qxlv: this.form.qxjb,
            qxmiaoshu: this.form.qxms,
            qxtype: this.form.leixin,
            rate: this.form.whl,
            rwid: this.form.rwid,
            xiauser: this.form.xfuser,
            xunjianrwid: this.form.xunjianrwid,
         xiaDate:this.form.date2,
         findtime:this.form.date1


          }


        }).then(vs => {

        }).catch(err => console.log(err));
      }
    }
  }
</script>

<style>
</style>
